#pragma once

#ifndef _CORE_TEMP_CONNECTION_H_
#define _CORE_TEMP_CONNECTION_H_

#include "Poco/Net/TCPServer.h"
#include "Poco/Net/TCPServerConnection.h"
#include "Poco/Net/TCPServerConnectionFactory.h"
#include "Poco/Net/TCPServerParams.h"
#include "Poco/SharedPtr.h"

namespace ExamSystem
{
    using Poco::Net::ServerSocket;
    using Poco::Net::StreamSocket;
    using Poco::Net::TCPServerConnection;
    using Poco::Net::TCPServerConnectionFactory;
    using Poco::Net::TCPServer;
    using Poco::SharedPtr;

    class CExamServerConnectionManager;

    class CTempConnection: public TCPServerConnection
    {
    public:
        CTempConnection(CExamServerConnectionManager *manager, const StreamSocket& s);

        virtual void run(void);

    protected:
        CExamServerConnectionManager *m_connectionManager;
    };

    class CTempConnectionFactory: public TCPServerConnectionFactory
    {
    public:
        CTempConnectionFactory(CExamServerConnectionManager *manager);

        TCPServerConnection* createConnection(const StreamSocket& socket);

    protected:
        CExamServerConnectionManager *m_connectionManager;
    };

}


#endif